<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets">
      
<h:head>
	<title>Create Basic Products</title>
</h:head>
<h:body>

	<h:form>
	 <p:menubar>  
        <p:submenu label="Packages Section" icon="ui-icon-gear">
          	<p:menuitem value="Index" icon="ui-icon-refresh" url="indexPackages.xhtml" />
            <p:separator />
            <p:menuitem value="Create Package" icon="ui-icon-contact" url="createPackage.xhtml"/>  
            <p:separator />
            <p:menuitem value="Search Package" icon="ui-icon-search" url="searchPackage.xhtml" />            
       </p:submenu>  
       <p:submenu label="Basic Products Section"  icon="ui-icon-gear">
            <p:menuitem value="Index" url="indexBasicProduct.xhtml" icon="ui-icon-refresh" />  
            <p:separator />  
            <p:menuitem value="Create Basic Product" icon="ui-icon-contact" url="createBasicProduct.xhtml" /> 
            <p:separator /> 
            <p:submenu label="Search Basic Product" icon="ui-icon-search" > 
            	<p:menuitem value="Search Residences" url="residences.xhtml" /> 
            	<p:menuitem value="Search Trasnports"  url="transports.xhtml" /> 
            	<p:menuitem value="Search Excursions" url="excursions.xhtml" /> 
            </p:submenu>
       </p:submenu>
     
        <f:facet name="options">  
              <p:commandButton type="submit" ajax="false" action = "createPackage" value="Go To The Package!" icon="ui-icon-gear" />
            <p:commandButton type="submit" ajax="false" action = "#{logoutBean.logout()}" value="Logout" icon="ui-icon-extlink" />  
        </f:facet>
       
       </p:menubar>
        </h:form>


	<p:panel header="Create Residence">
		<h:form id="resForm">
			<h:panelGrid columns="3" id="redGrid">
					<h:outputLabel for="available">Available*:</h:outputLabel>
					<p:selectBooleanCheckbox id="available" value="#{residence.currentResidence.available}" />
					<h:message for="available" />
		
					<h:outputLabel for="disponibility">Disponibility*:</h:outputLabel>
					<p:inputMask id="disponibility" value="#{residence.currentResidence.disponibility}" />
					<h:message for="disponibility" />
	
					<h:outputLabel for="price">Price*:</h:outputLabel>
					<p:inputMask id="price" value="#{residence.currentResidence.price}"  />
					<h:message for="price" />
		
					<h:outputLabel for="type">Residence Type*:</h:outputLabel>
					<p:inputText id="type" value="#{residence.currentResidence.type}" />
					<h:message for="type" />
	
					<h:outputLabel for="name">Name*:</h:outputLabel>
					<p:inputText id="name" value="#{residence.currentResidence.residenceName}"/>
					<h:message for="name" />

					<h:outputLabel for="city">City*:</h:outputLabel>
					<p:inputText id="city" value="#{residence.currentResidence.city}"/>
					<h:message for="city" />
					
					<h:outputLabel for="country">Country*:</h:outputLabel>
					<p:inputMask id="country" value="#{residence.currentResidence.country}"/>
					<h:message for="country" />

					<h:outputLabel for="address">Address*:</h:outputLabel>
					<p:inputMask id="address" value="#{residence.currentResidence.address}" />
					<h:message for="address" />
	
					<h:outputLabel for="fromDate">From*:</h:outputLabel>
					<p:calendar value="#{residence.currentResidence.fromDate}"  id="fromDate" />
					<h:message for="fromDate" />
	
					<h:outputLabel for="toDate">To*:</h:outputLabel>
					<p:calendar value="#{residence.currentResidence.toDate}" id="toDate"/>
					<h:message for="toDate" />
	
					<h:outputLabel for="site">Site:</h:outputLabel>
					<p:inputMask id="site" value="#{residence.currentResidence.site}"/>
					
					<br/>
					<h:outputLabel for="phone">Phone:</h:outputLabel>
					<p:inputMask id="phone" value="#{residence.currentResidence.phoneNumber}" />
					<h:message for="phone" />

					<h:outputLabel for="rooms">Rooms*:</h:outputLabel>
					<p:inputMask id="rooms" value="#{residence.currentResidence.rooms}" />
					<h:message for="rooms" />
	
					<h:outputLabel for="beds">Beds*:</h:outputLabel>
					<p:inputMask id="beds" value="#{residence.currentResidence.beds}" />
					<h:message for="beds" />
		
					<h:outputLabel for="stars">Stars:</h:outputLabel>
					<p:rating id="stars" value="#{residence.currentResidence.stars}" />
					<h:message for="stars" />
				</h:panelGrid>
    	    <p:commandButton value="Create" icon="ui-icon-disk" partialSubmit="true" action="#{residence.createResidence()}"  ajax="false" type= "submit"  update="resForm:redGrid" />
  		</h:form>
	</p:panel>
	

<p:panel header="Create Transport">
	<h:form id="transForm">
				<h:panelGrid columns="3" id="transGrid">
								
					<h:outputLabel for="available">Available*:</h:outputLabel>
					<p:selectBooleanCheckbox id="available" value="#{transport.currentTransport.available}" />
					<h:message for="available" />
	
					<h:outputLabel for="disponibility">Disponibility*:</h:outputLabel>
					<p:inputMask id="disponibility" value="#{transport.currentTransport.disponibility}" />
					<h:message for="disponibility" />
	
					<h:outputLabel for="price">Price*:</h:outputLabel>
					<p:inputMask id="price" value="#{transport.currentTransport.price}" />
					<h:message for="price" />

					<h:outputLabel for="type">Transport Type*:</h:outputLabel>
					<p:inputMask id="type" value="#{transport.currentTransport.type}" />
					<h:message for="type" />
		
					<h:outputLabel for="passengers">Number of Passengers*:</h:outputLabel>
					<p:inputMask id="passengers" value="#{transport.currentTransport.passengers}"/>
					<h:message for="passengers" />

					<h:outputLabel for="classNumber">Class*:</h:outputLabel>
					<p:inputMask id="classNumber" value="#{transport.currentTransport.classNumber}"/>
					<h:message for="classNumber" />
	
					<h:outputLabel for="fromPlace">From (Place)*:</h:outputLabel>
					<p:inputMask id="fromPlace" value="#{transport.currentTransport.fromPlace}" />
					<h:message for="fromPlace" />
	
					<h:outputLabel for="toPlace">To (Place)*:</h:outputLabel>
					<p:inputMask id="toPlace" value="#{transport.currentTransport.toPlace}" />
					<h:message for="toPlace" />
	
					<h:outputLabel for="departureDate">Departure Date*:</h:outputLabel>
					<p:calendar value="#{transport.currentTransport.departureDate}"  id="departureDate"/>
					<h:message for="departureDate" />
	
					<h:outputLabel for="departureTime">Departure Time*:</h:outputLabel>
					<p:calendar id="departureTime" value="#{transport.currentTransport.departureTime}"  pattern="HH:mm" timeOnly="true" />
					<h:message for="departureTime" />
					
					
					<h:outputLabel for="company">Departure Company:</h:outputLabel>
					<p:inputMask id="company" value="#{transport.currentTransport.company}" />
					<br/>
	
					<h:outputLabel for="flightId">Flight ID:</h:outputLabel>
					<p:inputMask id="flightId"  value="#{transport.currentTransport.flightId}" />


				
			</h:panelGrid>
 			<p:commandButton value="Create" partialSubmit="true" type="submit" action="#{transport.createTransport()}" icon="ui-icon-disk" ajax="false" update="transForm:transGrid" />
    	 
		</h:form>
	</p:panel>
	
	
		
 		<p:panel header="Create Excursion">
 			<h:form id="excForm">
 				<h:panelGrid columns="3" id="excGrid">
					<h:outputLabel for="available">Available*:</h:outputLabel>
					<p:selectBooleanCheckbox id="available"  value="#{excursion.currentExcursion.available}" />
					<h:message for="available"/>
				
					<h:outputLabel for="disponibility">Disponibility*:</h:outputLabel>
					<p:inputMask id="disponibility" value="#{excursion.currentExcursion.disponibility}" />
					<h:message for="disponibility" />
			
					<h:outputLabel for="price">Price*:</h:outputLabel>
					<p:inputMask id="price" value="#{excursion.currentExcursion.price}" />
					<h:message for="price" />
			
					<h:outputLabel for="type">Type*:</h:outputLabel>
					<p:inputMask id="type" value="#{excursion.currentExcursion.type}" />
					<h:message for="type" />
			
					<h:outputLabel for="description">Description*:</h:outputLabel>
					<p:inputTextarea id="description" value="#{excursion.currentExcursion.description}" rows="6" cols="33" />
					<h:message for="description" />
			
					<h:outputLabel for="date">Date*:</h:outputLabel>
					<p:calendar value="#{excursion.currentExcursion.date}"  id="date"/>
					<h:message for="date" />
		
					<h:outputLabel for="startTime">Start Time*:</h:outputLabel>
					<p:calendar id="startTime" value="#{excursion.currentExcursion.startTime}"  pattern="HH:mm" timeOnly="true" />
					<h:message for="startTime" />
		
					<h:outputLabel for="endTime">End Time*:</h:outputLabel>
					<p:calendar id="endTime" value="#{excursion.currentExcursion.endTime}"  pattern="HH:mm" timeOnly="true" />
					<h:message for="endTime" />			
				</h:panelGrid>
			<p:commandButton value="Create" partialSubmit="true" icon="ui-icon-disk" type="submit" action="#{excursion.createExcursion()}"  ajax="false"  update="excForm:excGrid" />
			
			</h:form>
	</p:panel>



</h:body>
</html>